<!-- 拼单弹出层 -->
<template>
	<u-popup :show="show" mode="center" round="30">
		<!-- 去拼单 -->
		<view class="pd_popup">
				<view class="text">参加{{info.nickName}}的拼单</view>
				<view class="time">仅剩<text class="num">{{info.surplus}}</text>个名额，<text
						class="red">{{info.times}}</text>后结束</view>
			<view class="photo">
				<view class="imgBox" v-for="(item,index) in info.spellMembers" :key="index">
					<avatar class="avatar" :src="item"></avatar>
					<view v-if="index==0" class="type">拼主</view>
				</view>
				<view class="imgBox" v-for="num in info.surplus" :key="num">
					<image class="avatar" src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/mine/vip/img9.png"></image>
				</view>
			</view>
				<view class="btn" @click="$emit('addGroup',info)">参与拼团</view>
		</view>
		<view class="close" @click="$emit('close')">
			<image src="https://yzxk.oss-cn-hangzhou.aliyuncs.com/images/mine/vip/close.png"></image>
		</view>

	</u-popup>
</template>

<script>
	import avatar from '@/components/avatar.vue'
	export default {
		components: {
			avatar
		},
		props: {
			show: {
				type: Boolean,
				default: false
			},
			info: {
				type: Object
			}
		}
	}
</script>

<style lang="scss" scoped>
	.close {
		width: 74rpx;
		height: 74rpx;
		position: absolute;
		bottom: -100rpx;
		left: 50%;
		transform: translateX(-50%);
		z-index: 100;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.pd_popup {
		padding: 46rpx 92rpx 44rpx;
		text-align: center;
		position: relative;

		.jl {
			margin: 54rpx 0;
		}

		.info {
			width: 476rpx;
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #868686;
		}

		.remain {
			font-size: 32rpx;
			font-family: Source Han Sans CN;
			font-weight: 500;
			color: #181818;

			.red {
				color: #FC4843;
				margin: 0 20rpx;
			}
		}

		.btn {
			background: #194FC9;
			box-shadow: 0px 12rpx 16rpx 0px rgba(82, 163, 255, 0.3000);
			border-radius: 40rpx;
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			width: 240rpx;
			height: 80rpx;
			margin: 0 auto;
			line-height: 80rpx;
			margin-top: 42rpx;
		}

		.text {
			font-size: 32rpx;
			font-family: Source Han Sans CN;
			font-weight: 500;
			color: #181818;
		}

		.time {
			font-size: 28rpx;
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #868686;
			margin: 22rpx 0 44rpx;

			.num {
				color: #FF8431;
			}
		}

		.photo {
			display: flex;
			justify-content: space-around;
			align-items: center;

			.imgBox {
				position: relative;
				width: 78rpx;
				height: 78rpx;
				border-radius: 50%;

				.avatar {
					width: 100%;
					height: 100%;
					border-radius: 50%;
					overflow: hidden;
				}

				.type {
					position: absolute;
					left: 50%;
					bottom: 0;
					transform: translate(-50%, 50%);
					padding: 0 10rpx;
					border-radius: 10rpx;
					white-space: nowrap;
					font-size: 22rpx;
					color: #ffffff;
					background: #FF8431;
				}
			}
		}
	}
</style>
